//
//  StaicParameter.m
//  TestTaoBaoAPI
//
//  Created by ZhuoLaiQiang@Gmail.com on 6/22/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "StaicParameter.h"
#import "NSString+Encode.h"

static NSMutableDictionary *parameterDic = nil;


@implementation StaicParameter

+ (NSMutableDictionary*)parameterDic
{
	if (!parameterDic) 
    {
		parameterDic = [[NSMutableDictionary alloc] init];
	}
    
	return parameterDic;
}

+ (void)setParameterDic:(NSMutableDictionary*)dic
{
    if (!dic) {
        return;
    }
    parameterDic = [[NSMutableDictionary alloc] initWithDictionary: dic];
}

+ (void)setDicWithValue:(NSString*)value key:(NSString*)key
{
    NSMutableDictionary *dic = [StaicParameter parameterDic];
    id object = [dic objectForKey: key];
    if (object) {
         [dic removeObjectForKey: key];
    }
   
    [dic setObject: value forKey: key];
}

+ (NSString*)getValueFormKey:(NSString*)key
{
    if ( !key ) 
    {
        return  nil;
    }
    
    NSMutableDictionary *dic = [StaicParameter parameterDic];
    return [dic objectForKey: key];
}

@end
